package com.gs.dao.jdbc.impl.rowmapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.gs.bean.User;
import com.liang.lang.util.StringUtils;

public class UserRowMapper implements RowMapper {

	@Override
	public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
		StringUtils su = new StringUtils("UTF-8","UTF-8");
		User user = new User();
		user.setId(rs.getInt("id"));
		user.setName(su.transcoding(rs.getString("name")));
		user.setPassword(su.transcoding(rs.getString("password")));
		return user;
	}

}
